<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<meta name="author" content="zhaozhenguo">
		<title>管理</title>
		<script language="javascript" src="../script/common.js" type="text/javascript"></script>
		<script language="javascript" type="text/javascript">
			//全局变量
			var org = Common.cOrg();	//当前单位	
			var qt = {};				//数据表格对象
			var type ;
			//页面加载方法
			function load(){
				Eui.showNavigation();
				Common.initDict(searchForm.vendor,"car_vendor","全部");		//初始化调整类型
				 type = getPara("type")
				if(type == "CarSeries"){
					$("tdBrand").style.display = "none";
					
				}else{
					$("optSerial").onchange = onBrandChange
				}
				DWR.call("carModelService.getSerialOrBrand","CarSeries",function(result){
					Common.initDict("optSerial",result,"请选择","id","name");	
				})
				
			}
			 
			function onBrandChange(){
				var id = this.value
				if(!id) return;
 				DWR.call("carModelService.getBrand",id,function(result){
					Common.initDict("optBrand",result,"请选择","id","name");	
				})
			}
			function onSave(){
					var nameWarning=""
					var select = {};
					if(type == "CarSeries"){
						nameWarning = "系列"
						select = $("optSerial")
					}else if(type == "CarBrand"){
						nameWarning = "品牌"
						select = $("optBrand")
					}
				if(!select.value){
					showWarning("请选择车辆"+nameWarning);return;
				}else{
					var res = {}
					res.id = select.value
					res.name = select.options[select.selectedIndex].text
					dialogBackValue(res);
				}
			}
			
		</script>
	</head>
	<body onload="load()">
		<!--页面导航-->
		<div class="nav"><div id="nav">&nbsp;</div></div>
			<div class="searchForm">
				<form id="searchForm" name="searchForm"> 
					<table cellSpacing=0 cellPadding=4 width="100%" border=0 >
					
                           <tr>
                           		<td>
	                           		<div class="lt10">系列</div>
	                           		<div class="lt6">
		                                 <select class="lt5" id="optSerial" size="13" name="optSerial"> </select>
		                            </div>
                                </td>
                                <td id="tdBrand">
                           			<div class="lt10">品牌</div>
                           			<div class="lt6">
                                 		<select class="lt12" id="optBrand" size="13" name="optBrand"> </select>
                                	</div>
                                </td>
                            </tr>
					</table>
				</form>
			</div>	
			<div id="datalist"></div>		
	</body>
</html>